package com.ev.asl.service;

import com.ev.asl.vo.ApiResultVO2S;
import com.ev.scm.domain.StockInDO;
import com.ev.scm.domain.StockInItemDO;
import com.ev.scm.domain.StockOutDO;
import com.ev.scm.domain.StockOutItemDO;
import com.ev.system.domain.UserDO;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.lang3.tuple.Triple;

import java.util.List;

/**
 * 业务单据的同步 推单
 */
public interface KisBillOfPushService {

    /**
     * 获取token接口
     */
    Triple<Boolean, String, ApiResultVO2S> getK3Token();

    /**
     * 审核产品入库
     */
    Triple<Boolean, String, ApiResultVO2S> checkK3In(String token, String FBillNo,String FChecker, boolean tryAgain);

    /**
     * 审核产品入库：不启动审核
     */
    Triple<Boolean, String, ApiResultVO2S> checkK3In2(String token, String FBillNo,String FChecker, boolean tryAgain);

    /**
     * 审核生产领料
     */
    Triple<Boolean, String, ApiResultVO2S> checkK3LinLiao(String token, String FBillNo,String FChecker, boolean tryAgain);

    /**
     * 审核生产领料：不启动审核
     */
    Triple<Boolean, String, ApiResultVO2S> checkK3LinLiao2(String token, String FBillNo,String FChecker, boolean tryAgain);

    // 入库类型参数转换 + 同步调用
    Pair<Boolean, String> inputTypeParamConversionSync(int rob, int type, List<StockInItemDO> stockInItemDO, StockInDO stockInDO);

    /**   在需要审批的地方，替代 masterSwitchForOutboundSync方法
     *                           采购入库  生产入库  生产退料       销售退货
     * @param rob               1            1     -1           -1
     * @param type              1           2      24           21
     * @param stockInItemDO
     * @param stockInDO
     * @return
     */
    Triple<Boolean, String, String> inputTypeParamConversionSync2(int rob, int type, List<StockInItemDO> stockInItemDO, StockInDO stockInDO);

    /**   在需要审批的地方，替代 masterSwitchForOutboundSync方法
     *                           采购入库  生产入库  生产退料       销售退货
     * @param rob               1            1     -1           -1
     * @param type              1           2      24           21
     * @param stockInItemDO
     * @param stockInDO
     * @return
     */
    Triple<Boolean, String, String> inputTypeParamConversionSync2(int rob, int type, List<StockInItemDO> stockInItemDO, StockInDO stockInDO, UserDO userDO);

    //入库实体单据汇总处理
    Pair<Boolean, String> masterSwitchForStorageSync(int inStockType, List<StockInItemDO> stockInItemDO, StockInDO stockInDO);


    //出库实体单据汇总处理
    Pair<Boolean, String> masterSwitchForOutboundSync(int outStockType, List<StockOutItemDO> stockInItemDO, StockOutDO stockOutDO);

    /**   在需要审批的地方，替代 masterSwitchForOutboundSync方法
     *                           采购退货  生产领用  销售出库
     * @param rob               -1          1       1
     * @param type              1           24      21
     * @param stockOutItemDO
     * @param stockOutDO
     * @return
     */
    Triple<Boolean, String, String> outTypeParamConversionSync2(int rob, int type, List<StockOutItemDO> stockOutItemDO, StockOutDO stockOutDO);

    /**   在需要审批的地方，替代 masterSwitchForOutboundSync方法
     *                           采购退货  生产领用  销售出库
     * @param rob               -1          1       1
     * @param type              1           24      21
     * @param stockOutItemDO
     * @param stockOutDO
     * @return
     */
    Triple<Boolean, String, String> outTypeParamConversionSync2(int rob, int type, List<StockOutItemDO> stockOutItemDO, StockOutDO stockOutDO, UserDO userDO);

        //调拨实体单据汇总处理
    Pair<Boolean, String> allocationParamConversionSync(int robBlue, int outStockType, List<StockOutItemDO> stockInItemDO, StockOutDO stockOutDO);


}
